<?php
if(!$confirmacao)
{
echo '<h2> Listar Alunos na Turma </h2>
<form action="/admin/listarAlunoTurma" method="post">
    <table cellpadding="0" cellspacing="0" border="0" class="form_table">
        <tr>
            <td valign="middle" align="right">Código da Disciplina:</td>
            <td valign="middle" align="left">
                <input name="disciplina_id" type="text" class="inputgri" />
            </td>
        </tr>
        <tr>
            <td valign="middle" align="right">Código da Turma:</td>
            <td valign="middle" align="left">
                <input name="turma_id" type="text" class="inputgri" />
            </td>
        </tr>
    </table>
    <p><input type="submit" class="button" value="Buscar Turma" /></p>
</form>';
}
else
{
echo '<h2> Lista dos Alunos da Turma Selecionada </h2>
      <tr>
        <td valign="middle" align="right">Disciplina:</td>
        <td valign="middle" align="left">'.$diarios[0]["disciplina"]["nome"].'</td>
      </tr><br/>
      <tr>
        <td valign="middle" align="right">Turma:</td>
        <td valign="middle" align="left">'.$diarios[0]["turma"]["id"].'</td>
      </tr><br/><br/><br/>
      <!-- table header -->
      <table cellpadding="0" cellspacing="0" border="0" width="100%" class="table">
      <tr class="table_header">
         <td valign="middle" align="left">Matrícula</td>
         <td valign="middle" align="left">Nome do Aluno</td>
         <td valign="middle" align="left">Opções</td>
      </tr>';
      foreach ($diarios as $diario)
      {
        echo '<!-- row type one -->
        <tr class="row1">
            <td valign="middle" align="left"><a href="/admin/detalhesAluno/'.$diario["users"]["id"].'">'.$diario["users"]["username"].'</td>
            <td valign="middle" align="left"><a href="/admin/detalhesAluno/'.$aluno["id"].'">'.$diario["users"]["nome"].'</td>
            <td valign="middle" align="left"><a href="/admin/excluirAlunoTurma/'.$diario["disciplina_id"].'/'.$diario["turma_id"].'/'.$diario["users_id"].'">Excluir</a></td>
        </tr>';
       }
       echo '</table>';
      
       

    
}
?>
